﻿using UnityEngine;
using System.Collections;

public class GameCamera : MonoBehaviour
{
    Transform mTraget;
    public Transform Target { get { return mTraget; } }
    public Camera Camera;
    void Start()
    {
        Camera = gameObject.GetComponent<Camera>();
    }
    public void LookAt(Transform t)
    {
        mTraget = t;
    }
    public  Vector3 Offset = new Vector3(0,10,-10);
    void LateUpdate()
    {
        if (mTraget == null)
        {
            return;
        }
        transform.position = mTraget.position+ Offset;
        transform.LookAt(mTraget);
    }
}
